﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using AMStudio.Windows.Forms;
using AMStudio.Common;

namespace AMStudio.UserInterface
{
    public partial class StationUI10 : StationUI
    {
        public StationUI10()
        {
            this.UIName = "StationUI10";
            this.StationIndex = 10;
            InitializeComponent();
        }
        public override bool ActivateUI()
        {
            bool result = base.ActivateUI();

            this.txtMarkingFile.Text = WorkorderDB.ActiveProduct.St10MarkingFile.ToString();
            this.txtSerialNO.Text = WorkorderDB.ActiveProduct.St10SerialOption.ToString();


            return result;
        }


        private void StationUI10_Load(object sender, EventArgs e)
        {
            base.SubscribeEvent("MANAGER_RET");
        }

        private void buttonX20_Click(object sender, EventArgs e)
        {
            SendMessage("SET_PATH", this.textBoxLaserPath.Text);
            SendMessage("SET_FILE", this.textBoxLaserFile.Text);
        }

        private void buttonX16_Click(object sender, EventArgs e)
        {
            SendMessage("SET_VAR", new string[]{this.textBoxLaserVar.Text,this.textBoxLaserValue.Text});
        }

        private void buttonX17_Click(object sender, EventArgs e)
        {

        }
        protected override void SetUserPrivilige(object sender, EventArgs e)
        {
            base.SetUserPrivilige(sender, e);
            User current = UserDB.CurrentLoginUser;
            //Control[] findCtl = null;
            switch (current.AuthorizationSet)
            {
                case 0:
                    this.tabItemMaintenace.Visible = true;
                    this.tabItemConfiguration.Visible = true;
                    this.tabItemRFTag.Visible = true;
                    this.tabItemIput.Visible = true;
                    this.tabItemOutput.Visible = true;
                    break;
                case 1:
                    this.tabItemMaintenace.Visible = true;
                    this.tabItemConfiguration.Visible = false;
                    this.tabItemRFTag.Visible = false;
                    this.tabItemIput.Visible = false;
                    this.tabItemOutput.Visible = false;
                    break;
                case 2:
                default:
                    this.tabItemMaintenace.Visible = false;
                    this.tabItemConfiguration.Visible = false;
                    this.tabItemRFTag.Visible = false;
                    this.tabItemIput.Visible = false;
                    this.tabItemOutput.Visible = false;
                    break;
            }
        }
    }
}
